package it.polimi.traveldream.web;

import java.util.ArrayList;
import java.util.List;

import it.polimi.traveldream.GestioneShowHotelLocal;
import it.polimi.traveldream.HotelDTO;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean(name="gestioneShowHotelLocal")
@RequestScoped
public class ShowHotelBean {
	
	
	@EJB
	private GestioneShowHotelLocal gestioneShowHotelLocal; 
	
	private List<HotelDTO> hotels;
	
	
	public String showHotels(){
		this.hotels=gestioneShowHotelLocal.showHotel();
		System.out.print(hotels.get(0).getName());
		return "showhotel.xhtml?faces-redirect=true";

		
	}
	
	public List<HotelDTO> getHotels(){
		this.hotels=gestioneShowHotelLocal.showHotel();
		return this.hotels;
	}
	
	public void setHotels(List<HotelDTO> hotels){
		this.hotels=hotels;
	}
	
	
	//metodo showHotel(){
	// hotels = gestioneShowHotelLocal.mostraHotels();
	//SELECT * FROM HOTELS;
	

}
